using MaterialSkin.Controls;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace VideoAutoGenerator.UI.UserControls
{
    public partial class BasicConfigControl : MaterialSkin.Controls.MaterialCard
    {
        public BasicConfigControl()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
            this.SuspendLayout();
            
            // 
            // BasicConfigControl
            // 
            this.Name = "BasicConfigControl";
            this.Size = new System.Drawing.Size(700, 500);

            // Create layout panel
            MaterialSkin.Controls.MaterialLabel mainPanel = new MaterialSkin.Controls.MaterialLabel();
            mainPanel.Dock = DockStyle.Fill;
            mainPanel.Padding = new Padding(10);
            
            // Add controls for basic configuration
            int top = 10;
            const int labelWidth = 120;
            const int textBoxWidth = 300;
            const int controlHeight = 35;
            const int spacing = 15;
            
            // Title
            Label titleLabel = new MaterialLabel();
            titleLabel.Text = "项目标题:";
            titleLabel.Location = new Point(10, top);
            titleLabel.Size = new Size(labelWidth, controlHeight);

            MaterialTextBox titleTextBox = new MaterialTextBox();
            titleTextBox.Location = new Point(labelWidth + 20, top);
            titleTextBox.Size = new Size(textBoxWidth, controlHeight);
            
            top += controlHeight + spacing;
            
            // Input DAT directory
            Label datDirLabel = new MaterialLabel();
            datDirLabel.Text = "输入DAT目录:";
            datDirLabel.Location = new Point(10, top);
            datDirLabel.Size = new Size(labelWidth, controlHeight);
            
            MaterialTextBox datDirTextBox = new MaterialTextBox();
            datDirTextBox.Location = new Point(labelWidth + 20, top);
            datDirTextBox.Size = new Size(textBoxWidth - 80, controlHeight);
            
            MaterialButton datDirButton = new MaterialButton();
            datDirButton.Text = "浏览...";
            datDirButton.Size = new Size(70, controlHeight);
            datDirButton.Location = new Point(labelWidth + 20 + textBoxWidth - 70, top);
            
            top += controlHeight + spacing;
            
            // Input MP3 directory
            Label mp3DirLabel = new MaterialLabel();
            mp3DirLabel.Text = "输入MP3目录:";
            mp3DirLabel.Location = new Point(10, top);
            mp3DirLabel.Size = new Size(labelWidth, controlHeight);

            MaterialTextBox mp3DirTextBox = new MaterialTextBox();
            mp3DirTextBox.Location = new Point(labelWidth + 20, top);
            mp3DirTextBox.Size = new Size(textBoxWidth - 80, controlHeight);
            
            MaterialButton mp3DirButton = new MaterialButton();
            mp3DirButton.Text = "浏览...";
            mp3DirButton.Size = new Size(70, controlHeight);
            mp3DirButton.Location = new Point(labelWidth + 20 + textBoxWidth - 70, top);
            
            top += controlHeight + spacing;
            
            // Output SRT directory
            Label srtDirLabel = new MaterialLabel();
            srtDirLabel.Text = "输出SRT目录:";
            srtDirLabel.Location = new Point(10, top);
            srtDirLabel.Size = new Size(labelWidth, controlHeight);
            
            MaterialTextBox srtDirTextBox = new MaterialTextBox();
            srtDirTextBox.Location = new Point(labelWidth + 20, top);
            srtDirTextBox.Size = new Size(textBoxWidth - 80, controlHeight);
            
            MaterialButton srtDirButton = new MaterialButton();
            srtDirButton.Text = "浏览...";
            srtDirButton.Size = new Size(70, controlHeight);
            srtDirButton.Location = new Point(labelWidth + 20 + textBoxWidth - 70, top);
            
            top += controlHeight + spacing;
            
            // Output video directory
            Label videoDirLabel = new MaterialLabel();
            videoDirLabel.Text = "输出视频目录:";
            videoDirLabel.Location = new Point(10, top);
            videoDirLabel.Size = new Size(labelWidth, controlHeight);
            
            MaterialTextBox videoDirTextBox = new MaterialTextBox();
            videoDirTextBox.Location = new Point(labelWidth + 20, top);
            videoDirTextBox.Size = new Size(textBoxWidth - 80, controlHeight);
            
            MaterialButton videoDirButton = new MaterialButton();
            videoDirButton.Text = "浏览...";
            videoDirButton.Size = new Size(70, controlHeight);
            videoDirButton.Location = new Point(labelWidth + 20 + textBoxWidth - 70, top);
            
            top += controlHeight + spacing;
            
            // Media storage directory
            Label mediaDirLabel = new MaterialLabel();
            mediaDirLabel.Text = "媒体存储目录:";
            mediaDirLabel.Location = new Point(10, top);
            mediaDirLabel.Size = new Size(labelWidth, controlHeight);
            
            MaterialTextBox mediaDirTextBox = new MaterialTextBox();
            mediaDirTextBox.Location = new Point(labelWidth + 20, top);
            mediaDirTextBox.Size = new Size(textBoxWidth - 80, controlHeight);
            
            MaterialButton mediaDirButton = new MaterialButton();
            mediaDirButton.Text = "浏览...";
            mediaDirButton.Size = new Size(70, controlHeight);
            mediaDirButton.Location = new Point(labelWidth + 20 + textBoxWidth - 70, top);
            
            top += controlHeight + spacing;
            
            // Pexels API Key
            Label apiKeyLabel = new MaterialLabel();
            apiKeyLabel.Text = "Pexels API密钥:";
            apiKeyLabel.Location = new Point(10, top);
            apiKeyLabel.Size = new Size(labelWidth, controlHeight);

            MaterialTextBox apiKeyTextBox = new MaterialTextBox();
            apiKeyTextBox.Location = new Point(labelWidth + 20, top);
            apiKeyTextBox.Size = new Size(textBoxWidth, controlHeight);
            
            top += controlHeight + spacing;
            
            // FFmpeg path
            Label ffmpegLabel = new MaterialLabel();
            ffmpegLabel.Text = "FFmpeg路径:";
            ffmpegLabel.Location = new Point(10, top);
            ffmpegLabel.Size = new Size(labelWidth, controlHeight);

            MaterialTextBox ffmpegTextBox = new MaterialTextBox();
            ffmpegTextBox.Location = new Point(labelWidth + 20, top);
            ffmpegTextBox.Size = new Size(textBoxWidth - 80, controlHeight);
            
            MaterialButton ffmpegButton = new MaterialButton();
            ffmpegButton.Text = "浏览...";
            ffmpegButton.Size = new Size(70, controlHeight);
            ffmpegButton.Location = new Point(labelWidth + 20 + textBoxWidth - 70, top);
            
            top += controlHeight + spacing;
            
            // Encoder format
            Label encoderLabel = new MaterialLabel();
            encoderLabel.Text = "编码格式:";
            encoderLabel.Location = new Point(10, top);
            encoderLabel.Size = new Size(labelWidth, controlHeight);
            
            ComboBox encoderComboBox = new ComboBox();
            encoderComboBox.Location = new Point(labelWidth + 20, top);
            encoderComboBox.Size = new Size(textBoxWidth, controlHeight);
            encoderComboBox.Items.Add("h264_nvenc");
            encoderComboBox.Items.Add("libx264");
            encoderComboBox.SelectedIndex = 0;
            
            // Add all controls to panel
            mainPanel.Controls.Add(titleLabel);
            mainPanel.Controls.Add(titleTextBox);
            mainPanel.Controls.Add(datDirLabel);
            mainPanel.Controls.Add(datDirTextBox);
            mainPanel.Controls.Add(datDirButton);
            mainPanel.Controls.Add(mp3DirLabel);
            mainPanel.Controls.Add(mp3DirTextBox);
            mainPanel.Controls.Add(mp3DirButton);
            mainPanel.Controls.Add(srtDirLabel);
            mainPanel.Controls.Add(srtDirTextBox);
            mainPanel.Controls.Add(srtDirButton);
            mainPanel.Controls.Add(videoDirLabel);
            mainPanel.Controls.Add(videoDirTextBox);
            mainPanel.Controls.Add(videoDirButton);
            mainPanel.Controls.Add(mediaDirLabel);
            mainPanel.Controls.Add(mediaDirTextBox);
            mainPanel.Controls.Add(mediaDirButton);
            mainPanel.Controls.Add(apiKeyLabel);
            mainPanel.Controls.Add(apiKeyTextBox);
            mainPanel.Controls.Add(ffmpegLabel);
            mainPanel.Controls.Add(ffmpegTextBox);
            mainPanel.Controls.Add(ffmpegButton);
            mainPanel.Controls.Add(encoderLabel);
            mainPanel.Controls.Add(encoderComboBox);
            
            // Add panel to control
            this.Controls.Add(mainPanel);
            
            this.ResumeLayout(false);
        }
    }
}